package com.dwxt.cdms.controller;

import com.dwxt.cdms.service.BloodSugarService;
import com.dwxt.cdms.service.TVService;
import com.dwxt.common.base.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cdms/api")
public class TVController {

    @Autowired
    private TVService tvService;

    @Autowired
    private BloodSugarService bloodSugarService;


    /**
    * @Description: 血压
    * @Param [customerId, scope]
    * @Return com.dwxt.common.base.BaseResult
    * @Author chendq
    * @Date 2021/12/2
    **/
    @RequestMapping("/selectBlutdruckListForTV")
    public BaseResult selectBlutdruckListForTV(@RequestParam(required = true) String customerId,
                                               @RequestParam(required = true,defaultValue = "1")Integer scope){
        return tvService.selectBlutdruckListForTV(customerId,scope);
    }

    /**
    * @Description: 心率
    * @Param [customerId, scope]
    * @Return com.dwxt.common.base.BaseResult
    * @Author chendq
    * @Date 2021/12/6
    **/
    @RequestMapping("/selectHeartVoiceListForTV")
    public BaseResult selectHeartVoiceListForTV(@RequestParam(required = true) String customerId,
                                               @RequestParam(required = true,defaultValue = "1")Integer scope){
        return tvService.selectHeartVoiceListForTV(customerId,scope);
    }


    @RequestMapping("/selectSugarListForTV")
    public BaseResult selectSugarListForTV(@RequestParam(required = true) Integer customerId,
                                           @RequestParam(required = true,defaultValue = "1")Integer scope,
                                           @RequestParam(required = true,defaultValue = "0")Integer partId){
        return bloodSugarService.selectCustomerSugarFromPoctOrAi(customerId, scope, partId);
    }
}
